package com.googlecode.animator.data.materials
{
	import com.googlecode.animator.data.IValueObject;
	
	public class ColorMaterialVO extends MaterialVO
	{
		public static const TYPE:String = "ColorMaterial";
		
		public static const FILL_ALPHA:uint = 100;
		
		public static const FILL_COLOR:uint = 0xff0000;
		
		public var fillAlpha:Number = FILL_ALPHA;
		
		public var fillColor:uint = FILL_COLOR;
	
		override public function clone(src:* = null):IValueObject
		{
			var clone:IValueObject = super.clone(new ColorMaterialVO());
			
			(clone as ColorMaterialVO).fillAlpha = this.fillAlpha;
			(clone as ColorMaterialVO).fillColor = this.fillColor;
			
			return (clone as ColorMaterialVO);
		}
		
		override public function toXML(src:XML = null):XML
		{
			var xml:XML = super.toXML(new XML(<{TYPE}></{TYPE}>));
			
			xml.appendChild(<fillAlpha>{this.fillAlpha}</fillAlpha>);
			xml.appendChild(<fillColor>{this.fillColor}</fillColor>);

			return xml;
		}
		
		override public function fromXML(src:XML):void
		{
			super.fromXML(src);
			
			this.fillAlpha = src.fillAlpha;
			this.fillColor = src.fillColor;
	
		}
	}
}